package top.yuyufeng;

/**
 * @author yuyufeng
 * @date 2018/11/8.
 */
public enum TransTypeEnum {
    CHAT_ONE("chat_one", "聊天"), CHAT_ALL("chat_all", "群发");

    private String key;
    private String value;

    private TransTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static String getValueBykey(Integer key) {
        if (key == null) {
            return "";
        }
        for (TransTypeEnum e : TransTypeEnum.values()) {
            if (e.getKey().equals(key)) {
                return e.getValue();
            }
        }
        return "";
    }
}
